<?php
define('HOSTNAME','127.0.0.1');//myspl所在服,务器的IP地址
define('USERNAME','root');//mysql账号
define('PASSWORK','123456');//mysql密码
define('DATABASE','23summ');//数据库名
define('PORT','3306');//端口，3306

function mysql_link()
{
    $conn=mysqli_connect(HOSTNAME,
        USERNAME,
        PASSWORK,
        DATABASE,
        PORT);
//检测是否连接成功
    if ($conn->connect_error){
        die("连接失败".$conn->connect_error);
    }
    return $conn;
}
//if (mysql_link()){
//    echo"连接成功";
//}






?>